package com.myapp.business;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import javax.inject.Named;

@Named
public class TimerEvent {
	public String getCycle() {
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(new Date());
		calendar.add(Calendar.SECOND, 10);
		Date startTime = calendar.getTime();
		
		return iso8601(startTime);
	}
	
	private String iso8601(Date date) {
		DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
		String dateStr = dateFormat.format(date);
		System.out.println("Date: " + dateStr);
		return dateStr;
	}
}